export function uploadFile(type, tempFilePath, token, query="") {
	return new Promise((resolve, reject) => {
		uni.uploadFile({
			url: process.env.VUE_APP_BASE_URL + '/upload/' + type + query,
			filePath: tempFilePath,
			name: type,
			header: {
				authorization: 'Bearer ' + token
			},
			timeout: 10000,
			success: function(uploadFileRes) {
				resolve(uploadFileRes.data);
			},
			fail: function(err) {
				reject(err)
			}
		});
	})
}
